
<div class="login">
    <div class="loginForm">
        <form class="layui-form" class="loginForm" id="loginForm" lay-filter="" onsubmit="return false">
            <div class="logoHead">
                <h2 style="margin-top: 15px">用户登录</h2>
            </div>
            <div class="login-line">
                <i class="layui-icon layui-icon-username adminIcon"></i>
                <input id="loginName" class="layui-input" type="text" name="loginName" lay-verify="required" lay-reqText="用户名不能为空" placeholder="用户名" >
            </div>
            <div class="login-line margin-top">
                <i class="layui-icon layui-icon-password adminIcon"></i>
                <input id="password" class="layui-input" lay-verify="required|password" lay-reqText="密码不能为空" type="password" name="password" placeholder="密码">
            </div>
            <div class="usernameWrapDiv margin-top-big">
                <div class="submitDiv">
                    <input id="loginBtn" type="submit" lay-submit lay-filter="loginForm" class="submit layui-btn layui-btn-primary" value="登录"></input>
                </div>
                <div class="submitLabel margin-top">
                    <label>没有账号？<a href="${ctxPath}${tpl}/reg.do" id="loginRegister">点击注册</a></label>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    layui.use(['form','layer'], function(){
        var login = layui.login;
        var form = layui.form;

        form.on('submit(loginForm)', function(data){
            Common.info("正在登陆");
            Lib.submitForm("/core/member/login.json", $(data.form), {}, function(data){
                Common.info("登录成功");
                document.location.href= Common.ctxPath + "/space/index.do"
            })
        });
    });
</script>